% Sheperd plot from our timing data
% Takes a 2D array of times, 1 subject per row; each row is generated by 
% plotShepard(...);
% Generates a plot like Sheperd and Metzler and includes SEM.

function plotShepardMultipleSubjects(subject_times)

for group = 1:size(subject_times,2)
    [means(group) sems(group)]=grpstats( subject_times(:,group),[],{'mean', 'sem'})
end

errorbar([0 90 180 270],means,sems)
xlabel('Angular difference (degrees)','FontSize',12)
ylabel('Response time (ms)','FontSize',12)
set(gca, 'XTick', [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300]);
axis([-30 300 0 1200])